package Tostring;

public class Teststudent {
    public static void main(String[] args) throws CloneNotSupportedException {
        /*
        tostring 方法一般是为了重写显示对象的内容
        equals也是被重写的命运,改写成判断对象是否内容相同的，原来是判断两者地址是否相同
         */
        Studentinfo s=new Studentinfo();
        s=new Studentinfo("Libai1",19,new int[] {19,20});
        System.out.println(s.getAge());
        System.out.println(s.getName());
        System.out.println(s.getScore()[1]);
        System.out.println("===========================");
//        Studentinfo s2=new Studentinfo();


//        s2=new Studentinfo("Libai1",19,new int[] {19,20});
         Studentinfo x= (Studentinfo) s.clone();//克隆时需要强转一下
        System.out.println(x.getAge());
        System.out.println(x.getName());
        System.out.println(x.getScore()[1]);
//        System.out.println(s.equals(s2));

    }
}
